// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

const int N = 1e5+50;

int n;

#define test _test

pair<int, int> a, b;

inline bool test(int x, int y) {
    // dbg(x, y, a.first, b.first);
    bool res = a.first <= x && x <= b.first && a.second <= y && y <= b.second;
    // dbg(res);
    return res;
}

int main(int argc, char const *argv[]) {
    // code
    int t;
    scanf("%d", &t);
    for (int kk=0; kk<t; ++kk) {

        int aa, bb, cc, dd;
        scanf("%d%d%d%d", &aa, &bb, &cc, &dd);
        pair<int, int> s;
        scanf("%d%d%d%d%d%d", &s.first, &s.second, &a.first, &a.second, &b.first, &b.second);
        bool flag = test(s.first, s.second) && test(s.first + bb-aa, s.second + dd-cc);
        bool l = (aa && test(s.first-1, s.second)) || (bb && test(s.first+1, s.second)) || (aa+bb==0);
        bool r = (cc && test(s.first, s.second-1)) || (dd && test(s.first, s.second+1)) || (cc+dd==0);
        // dbg(flag, l, r);
        if (flag && l && r)
            puts("Yes");
        else
            puts("No");

    }
    return 0;
}
